from django.db import models

from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
# 教师表
class Teacher(models.Model):
    # db_column为数据库表头名，verbose_name为后台页面列表中显示的字段名
    # teacher = models.OneToOneField(User, default="", on_delete=models.CASCADE, verbose_name='用户')
    tzh=models.CharField(max_length=200, db_column='账号', verbose_name='账号')

    tname = models.CharField(max_length=200, db_column='名字', verbose_name='名字')
    tpas=models.CharField(max_length=200, db_column='密码', verbose_name='密码')
    tgender = models.CharField(default='男',max_length=200,  db_column='性别', verbose_name='性别')
    tpy=models.CharField(default='0',max_length=200,  db_column='类型', verbose_name='类型')#0为教师 1为管理
    # ttime= models.CharField(max_length=200, db_column='课时', verbose_name='课时')
    tid = models.CharField(max_length=20, db_column='头像', verbose_name='头像')
    isDelete = models.BooleanField(db_column='是否删除', default=False)
    #
    # def __str__(self):
    #     return "%s-%s" % (self.tname, self.tid)

    # 元选项
    class Meta:
        db_table = 'teachers'
        ordering = ['id']
class ks(models.Model):
    tname= models.CharField(max_length=20, db_column='名字', verbose_name='名字')
    klx=models.CharField(max_length=20, db_column='类型', verbose_name='类型')
    kssj=models.CharField(max_length=20, db_column='开始时间', verbose_name='开始时间')
    ksjs = models.CharField(max_length=20, db_column='结束时间', verbose_name='结束时间')
    ksj = models.CharField(max_length=20, db_column='时间', verbose_name='时间')
    knr = models.CharField(max_length=200, db_column='备注', verbose_name='备注')
    ksq=models.DateTimeField(auto_now=True, verbose_name='创建时间')
class House(models.Model):
    name = models.CharField(max_length=200, db_column='name', verbose_name='账号')
    city = models.CharField(max_length=200, db_column='city', verbose_name='城市')
    money = models.CharField(max_length=200, db_column='money', verbose_name='价格')
    geju = models.CharField(max_length=200, db_column='house', verbose_name='格局')
    mj = models.CharField(max_length=200, db_column='mj', verbose_name='面积')
    img = models.CharField(max_length=200, db_column='img', verbose_name='图片')
    address = models.CharField(max_length=200, db_column='address', verbose_name='地址')

    class Meta:
        ordering = ['id']
